package types

type Schema struct {
	Name         string      `json:"name" yaml:"name"`
	PrimaryField string      `json:"primary_field" yaml:"primary_field"`
	Fields       []FieldDesc `json:"fields" yaml:"fields"`
}

func (s *Schema) FieldNames() []string {
	names := make([]string, 0, len(s.Fields))
	for _, f := range s.Fields {
		names = append(names, f.Name)
	}
	return names
}

func (s *Schema) NumFields() int {
	return len(s.Fields)
}
